#lang racket
(require "Server/package.rkt" "Global/package.rkt" "Generation/package.rkt")

(define-class* server%
  (super eserv%)
  (effectful-server-module<%>)
  
  (define universe (build-universe))
  
  ;; creates a player from that id and injects it
  (define/override (on-new id)
    (send universe inject (create-new-player id)))
  
  ;; removes that player from the world
  (define/override (on-disconnect id)
    (let ([p (send universe get-player-by-id id)])
      (when p (send universe kill p))))
  )